package com.bbu.javaexam;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author Alex
 * @version 1.0.0
 * @ClassName MybatisPlusConfig.java
 * @Description TODO
 */
@EnableTransactionManagement
@Configuration
@MapperScan("com.bbu.javaexam.service.*.dao*")
public class MybatisPlusConfig {
    /**
     * @throws
     * @title MyBatis Plus的分页插件（功能强大！！！！）
     * @description
     * @author Alex
     */
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor mp = new MybatisPlusInterceptor();
        mp.addInnerInterceptor(new PaginationInnerInterceptor());
        return mp;
    }
}
